<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>管理员登录界面</title>
    <!-- Vendor CSS -->
    <link href="${pageContext.request.contextPath}/static/login/css/material-design-iconic-font/css/material-design-iconic-font.min.css" rel="stylesheet" type="text/css" />
    <!-- CSS -->
    <link href="${pageContext.request.contextPath}/static/login/css/app.min.1.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">

        function submitData(){
            var adminName=$("#username").val();
            var adminPassword=$("#password").val();
            if(adminName==""){
                alert("请输入用户名！");
                return;
            }
            if(adminPassword==""){
                alert("请输入密码！");
                return;
            }
            $.ajax({
                url: _server + "/bssp/user/adminLogin",
                type: 'post',
                dataType: 'json',
                data: {"Name":adminName,"Password":adminPassword},
                xhrFields: {
                    withCredentials: true
                },
                success: function (result) {
                    if (result.code==1){
                        layer.msg("登陆成功",{time:1500},function () {
                            window.location.href="http://localhost:8085/bssp/main/manageFilm"
                        });

                    }else{
                        layer.alert(result.data);
                    }
                },
                error: function () {
                    layer.msg("请求失败",{time:1500});
                }
            });
        }
    </script>
</head>
<body class="login-content" data-ng-controller="loginCtrl as lctrl">
<div class="lc-block2" id="l-login" data-ng-class="{'toggled':lctrl.login === 1}">
<form id="fm"  method="post">
    <h1 class="lean">login</h1>
    <div class="input-group m-b-20">
	    		<span class="input-group-addon">
	    			<i class="zmdi zmdi-account"></i>
	    		</span>
        <div class="fg-line">
            <input  type="text" value=""  id="username" name="username" class="form-control" placeholder="userName" regex="^\w{3,16}$"/>
        </div>
    </div>

    <div class="input-group m-b-20">
	    		<span class="input-group-addon">
	    			<i class="zmdi zmdi-male"></i>
	    		</span>
        <div class="fg-line">
            <input  type="password"  id="password" name="password" class="form-control" placeholder="password" regex="^\w+"/>
        </div>
    </div>

    <div class="clearfix"></div>
    <div th:if="${param.error}">
        <font color="red">用户名或者密码错误!</font>
    </div>



    <a href="javascript:submitData()" class="btn btn-login btn-danger btn-float">
        <i class="zmdi zmdi-arrow-forward"></i>
    </a>

</form>
</div>
</body>

<script src="${pageContext.request.contextPath}/static/login/js/log.js"></script>
<!-- Angular -->
<script src="${pageContext.request.contextPath}/static/login/js/bower_components/angular/angular.min.js"></script>
<script src="${pageContext.request.contextPath}/static/login/js/bower_components/angular-resource/angular-resource.min.js"></script>
<script src="${pageContext.request.contextPath}/static/login/js/bower_components/angular-animate/angular-animate.min.js"></script>


<!-- Angular Modules -->
<script src="${pageContext.request.contextPath}/static/login/js/bower_components/angular-ui-router/release/angular-ui-router.min.js"></script>
<script src="${pageContext.request.contextPath}/static/login/js/bower_components/angular-loading-bar/src/loading-bar.js"></script>
<script src="${pageContext.request.contextPath}/static/login/js/bower_components/oclazyload/dist/ocLazyLoad.min.js"></script>
<script src="${pageContext.request.contextPath}/static/login/js/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>

<!-- Common js -->
<script src="${pageContext.request.contextPath}/static/login/js/bower_components/angular-nouislider/src/nouislider.min.js"></script>
<script src="${pageContext.request.contextPath}/static/login/js/bower_components/ng-table/dist/ng-table.min.js"></script>


<script src="${pageContext.request.contextPath}/static/login/js/app.js"></script>
<script src="${pageContext.request.contextPath}/static/login/js/controllers/main.js"></script>
<script src="${pageContext.request.contextPath}/static/login/js/controllers/ui-bootstrap.js"></script>
<script src="${pageContext.request.contextPath}/static/js/common.js"></script>
<script src="${pageContext.request.contextPath}/static/jquery/jquery-3.1.1.min.js"></script>
<script src="${pageContext.request.contextPath}/static/layer/layer.js"></script>
<script src="${pageContext.request.contextPath}/static/js/common.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery.cookie.js"></script>

<!-- Template Modules -->
<script src="${pageContext.request.contextPath}/static/login/js/modules/form.js"></script>
</html>